<%--
  Created by IntelliJ IDEA.
  User: OYXP911
  Date: 2018/7/28
  Time: 15:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="stylesheet" type="text/css" href="./css/H-ui.min.css"  />
    <link rel="stylesheet" type="text/css" href="./css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="./css/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="./css/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="./css/style.css" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>

    <title>Title</title>



</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 查看安装员 <span class="c-gray en">&gt;</span> 删除安装员 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">

    <table class="table table-border table-bordered table-hover table-bg">

        <tr>
            <th scope="col" colspan="6">删除安装员</th>
        </tr>
        <tr>
            <th>员工ID</th>
            <th>代理ID</th>
            <th>类型</th>
            <th>姓名</th>
            <th>电话</th>
            <th>邮箱</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${li}" var="l">
            <tr>
                <td>${l.staffid}</td>
                <td>${l.agencyid}</td>
                <td>${l.type}</td>

                <c:forEach items="${l.list}" var="ll">
                    <td>${ll.uname}</td>
                    <td>${ll.uphone}</td>
                    <td>${ll.uemail}</td>
                </c:forEach>
                <td class="td-manage">
                    <a title="删除" class="sc" href="javascript:;">
                        <i class="layui-icon">&#xe640;</i>
                    </a>
                </td>
            </tr>
        </c:forEach>
    </table>
</div>


<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="./js/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
    $(function () {
        var $tr;
        var id;
        $(".sc").click(function () {
            $tr=$(this).parent().parent();
            id=$tr.children().get(0).textContent;
            layer.confirm('确认要删除吗？',function(index){
                if(index>0){
                    $.post("StaffDelServlet",{"id":id},function (data) {
                        if(data>0){
                            $tr.remove();
                            layer.msg('已删除!',{icon:1,time:1000});
                        }else{
                            layer.msg('删除失败!',{icon:1,time:1000});
                        }
                    });
                }
            });

        });
    });
</script>
</body>
</html>
